![]() |
Installation | Features | Example | Tech Support | Specification Download Evaluation Copy (100k) | Purchase The Universal SMTP Mailer ⌐ 1998-1999 Geocel International, Inc. |
Introduction DevMailer is a COM (Component Object Model) object designed to send Email via SMTP from any COM/OLE/ActiveX enabled application. Currently DevMailer can be used from the following platforms:
Installation
How DevMailer Works
How Queueing Works in DevMailer To: recipient@somedomain.com From: support@geocel.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bitThere well likely be other optional fields, such as æSubject:Æ, 'CC:', and æBCC:Æ also present in the generated file, as well as header fields that are ignored by DevMailer but were present in the original input fileÆs message header. All standard SMTP headers may be used and will function according to the SMTP standards dictated in RFC #822. The only non-standard header recognized by DevMailer (and handled internally) is 'ATTACH: filename.ext'. Any queued messages with file attachments will include this in the header text. Note that attachments in DevMailer are unlimited, and each attachment will be listed line by line. Note that these headers need not be in any particular order. The next section of the of queued file is the message body (text) itself. This is seperated by a blank line between the message header and the message body. The following is a simple example:
How Logging Works in DevMailer Usage Examples (VBScript, Visual Basic) More
Other Language and Advanced Examples Purchasing / Licensing
Technical Support
Interface Specifications |
Basic Required Properties/Methods | ||||||
---|---|---|---|---|---|---|
Type | Name | VB Usage Example | Default | |||
Property String ( R / W ) |
FromAddress | Mailer.FromAddress = "email@domain.com" |
DevMailer | |||
Address message is sent from. Replies go to this address by default, but can be optionally be redirected by the ReplyTo property. | ||||||
Property String ( R / W ) |
Body | Mailer.Body = "Test message body." |
none | |||
Message body | ||||||
Method | AddServer(server, port) | Mailer.AddServer "mail", 25 Mailer.AddServer "backup.domain.com", 25 |
port usually 25 | |||
Add a mail server. Multiple mail servers can be added, and if the first does connect DevMailer will try the next. The number of redundant servers is unlimited. | ||||||
Method | AddRecipient(email, name) | Mailer.AddRecipient "email@domain.com", "John Doe" Mailer.AddRecipient "email2@domain.com","" |
none | |||
Add a recipient. A friendly name can be specified, in which case the email address would appear "Email Recipient | ||||||
Method Boolean | Send() | Success = Mailer.Send() If Success = True Then Write "Message sent successfully." Else Write "Message could not be sent." If Mailer.Queued = True Then Write "Message Queued Instead." End If End If |
none | |||
Send specified Message to specified Recipients via specified Server. Returns FALSE if message cannot be delivered. |
Optional Address Properties/Methods | ||||||
---|---|---|---|---|---|---|
Type | Name | VB Usage Example | Default | |||
Property String ( R / W ) |
FromName | Mailer.FromName = "John Doe" |
none | |||
Friendly name message is sent from. This is usually displayed in email client programs. | ||||||
Property String ( R / W ) |
ReplyTo | Mailer.ReplyTo = "email@domain.com" |
none | |||
This property specifies a separate Reply-To address for this message. This overrides the FromAddress when a email client replies to this message. (ie. email@domain.com) | ||||||
Method | AddCCRecipient(Email, Name) | Mailer.AddCCRecipient "email@domain.com", "John Doe" |
none | |||
Add a CC: recipient. A friendly name can be specified, in which case the email address would appear "Email Recipient | ||||||
Method | AddBCCRecipient(Email, Name) | Mailer.AddBCCRecipient "email@domain.com", "John Doe" |
none | |||
Add a BCC: recipient. A friendly name can be specified, but is not displayed. BCC: recipients are never displayed in the message header. | ||||||
Method | ClearAllRecipients() | Mailer.ClearAllRecipients |
none | |||
Clear all TO:, CC:, and BCC: recipients. | ||||||
Method | ClearToRecipients() | Mailer.ClearToRecipients |
none | |||
Clear all TO: recipients. | ||||||
Method | ClearCCRecipients() | Mailer.ClearCCRecipients |
none | |||
Clear all CC: recipients. | ||||||
Method | ClearBCCRecipients() | Mailer.ClearBCCRecipients |
none | |||
Clear all BCC: recipients. |
Optional Header Properties | ||||||
---|---|---|---|---|---|---|
Type | Name | VB Usage Example | Default | |||
Property String ( R / W ) |
Subject | Mailer.Subject = "This is the new Subject" |
none | |||
Subject of the message being sent. | ||||||
Property Integer ( R / W ) |
Priority | Mailer.Priority = 1 |
0 | |||
Sets the X-Priority setting in the Message Header. Valid settings are 0 [disabled], and 1 [highest] - 5 [lowest]. | ||||||
Property String ( R / W ) |
ContentType | Mailer.ContentType = "text/html" |
"text/plain" | |||
Content-Type for the Body of the message. To create HTML Email set this property to "text/html". | ||||||
Property String ( R / W ) |
CharSet | Mailer.CharSet = "ISO-8859-1" |
"us-ascii" | |||
Character Set used in the Message Body. | ||||||
Property Boolean ( R / W ) |
SendRawBody | Mailer.SendRawBody = True |
FALSE | |||
Send raw message body, as in Body property. Setting this value to TRUE will cause Header information to be ignored, and will only send the Body. If necessary, a header can be faked here. | ||||||
Method | AddRawHeader(name, value) | Mailer.AddRawHeader "X-Organization", "Imaginary Company" |
none | |||
Add a Custom Header field. For example: AddRawHeader("TO","email@domain"). |
Attachment Methods | ||||||
---|---|---|---|---|---|---|
Type | Name | VB Usage Example | Default | |||
Method Boolean | AddAttachment(filename) | Success = Mailer.AddAttachment(FileName) If Success = False Then Write "Could not add attachment" End If |
none | |||
Adds an file attachment to the message. Currently, only MIME attachments are supported. Returns TRUE upon success and FALSE upon failure. | ||||||
Method | ClearAllAttachments() | Mailer.ClearAllAttachments |
none | |||
Clears any existing File Attachments. |
Advanced Connection Properties/Methods | ||||||
---|---|---|---|---|---|---|
Type | Name | VB Usage Example | Default | |||
Property Integer ( R / W ) |
ConnectTimeout | Mailer.ConnectTimeout = 30 |
60 | |||
Number of seconds to wait for an SMTP Connection. | ||||||
Method Boolean | Connect() | Success = Mailer.Connect() If Success = False Then Write "Connection Failed." End If |
none | |||
Manually force Connection to SMTP Server. Send() can be called several times on one connection. By default, this is called automatically by Send(), however Send() will use an existing connection if available. Returns TRUE upon success and FALSE upon failure. | ||||||
Method Boolean | Disconnect() | Success = Mailer.Disconnect() If Success = False Then Write "Disconnect Failed." End If |
none | |||
Manually disconnect from SMTP Server. This should correspond to a manual Connect() call. Returns TRUE upon success and FALSE upon failure. | ||||||
Method | Reset() | Mailer.Reset |
none | |||
Reset SMTP Connection State and Message settings. If connected, "RSET" is sent to the SMTP Server to reset the server state. |
Failsafe Queue Properties/Methods | ||||||
---|---|---|---|---|---|---|
Type | Name | VB Usage Example | Default | |||
Property Boolean ( R / W ) |
QueueAutomatically | Mailer.QueueAutomatically = False |
True | |||
Use this property to control the Auto-Queue feature. By default, messages for which Send() fails are automatically Queued. | ||||||
Property Boolean ( R / W ) |
Queued | If Mailer.Queued = True Then Write "Message Successfully Queued" End If |
False | |||
This boolean value is True when the last Send() command failed, and the message was successfully Queued. | ||||||
Property String ( R / W ) |
QueueDirectory | Mailer.QueueDirectory = "D:\DMQUEUE" |
C:\TEMP | |||
This property allows the user to specify a custom Queue directory. The user which DevMailer is running as should have full control of this directory. | ||||||
Method Boolean | QueueMessage() | Mailer.QueueMessage() |
none | |||
Use this method to Queue the current message. This can only be called once per message. This is automatically called if a server-error occurs while attempting to send a message (and QueueAutomatically = True). | ||||||
Method Integer | FlushQueue() | Mailer.FlushQueue() |
none | |||
Use this method to flush the message Queue. All .QDM files in QueueDirectory will be processed. Any messages which fail for non-server reasons are renamed to "FILENAME.QDM.ERR". This is automatically called by Send() when a successful message is sent (and QueueAutomatically = True). Returns the number of messages flushed from Queue. |
Message File Methods | ||||||
---|---|---|---|---|---|---|
Type | Name | VB Usage Example | Default | |||
Method Boolean | LoadBodyFromFile(filename) | Success = Mailer.LoadBodyFromFile("C:\TEMP\REPORT.TXT") If Success = False Then Write "Could not load body file." End If |
none | |||
This method loads the contents of a specified file into the Body of the message. This should be an ASCII file. | ||||||
Method Boolean | LoadMessageFromFile(filename) | Success = Mailer.LoadMessageFromFile("C:\TEMP\REPORT.TXT") If Success = False Then Write "Could not load message file." End If |
none | |||
This method loads the contents of a standard message file into DevMailer. This parses all relevant header information. This can be used to manually load a Queued message file. |
Demo/Version Properties | ||||||
---|---|---|---|---|---|---|
Type | Name | VB Usage Example | Default | |||
Property Boolean ( R / W ) |
IsDemo | If Mailer.IsDemo = True Then Write "This is the Demo Version." End If |
True in Demo False Otherwise |
|||
True if this is the Demo version, False if this is a licensed version. | ||||||
Property Integer ( R / W ) |
DemoUsesLeft | Success = Mailer.LoadMessageFromFile("C:\TEMP\REPORT.TXT") If Success = False Then Write "Could not load message file." End If |
250 demo uses | |||
Integer value of Remaing Demo Uses. If IsDemo = True, 0 means that all uses have expired. | ||||||
Property String ( R / W ) |
Version | Write "Software version : " & Mailer.Version |
||||
String value of Product/Version information. |
LogFile Properties | ||||||
---|---|---|---|---|---|---|
Type | Name | VB Usage Example | Default | |||
Property Level ( R / W ) |
LogLevel | Mailer.LogLevel = 0 ' Turn Logging Off Mailer.LogLevel = 4 ' Verbose Logging |
2 - Success | |||
0 - None 1 - Basic (failures only) 2 - Success (log successful sends) 3 - Extended 4 - Verbose (Greatest Logging) | ||||||
Property String ( R / W ) |
LogFile | Mailer.Logfile = "C:\LOGS\DEVMAILER.LOG" |
||||
This is the name of the logfile you wish to use. This of course can be any UNC path. |